package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IPlanConfigDao;
import com.guoxue.domain.PlanConfigVo;
@Repository
public class PlanConfigDaoImpl extends BaseDaoImpl<PlanConfigVo> implements IPlanConfigDao {

	@Override
	public void savePlanConfig(PlanConfigVo pc) {
		saveOrUpdate(pc);
	}

	@Override
	public List<PlanConfigVo> getPlanConfigList() {
		return find("From PlanConfigVo");
	}

	@Override
	public void deletePlanConfig(int id) {
		executeHql("DELETE FROM PlanConfigVo p WHERE p.planId=?",new Object[] {id});
	}

	@Override
	public List<PlanConfigVo> getPlanConfigListByPlan(int beginId, int endId) {
		return find("From PlanConfigVo p WHERE p.planId >=? AND p.planId<=?", new Object[] {beginId,endId});
	}

	@Override
	public PlanConfigVo getPlanConfig(int planId) {
		return get("From PlanConfigVo p WHERE p.planId=?",new Object[] {planId});
	}

}
